home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 66
/
Vol 66.iso
/
games
/
doodle_d.swf
/
scripts
/
DefineSprite_42_en6
/
frame_1
/
DoAction.as
Wrap
Text File
|
2013-04-24
|
2KB
|
76 lines
function onEnterFrame()
{
_X = _X + dx;
if(_X < 0 || _X > 640)
{
dx *= -1;
_X = _X + dx * 2;
}
timer++;
if(timer > 20)
{
timer = 0;
fireLaser();
}
if(this.hitTest(_root.ship))
{
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X;
exp._y = _Y;
_root.death();
this.removeMovieClip();
}
if(h <= 0)
{
_root.eAmount = 0;
trace(_root.eAmount);
trace(_root.dead);
_root.points += 1000;
_root.eD = _root.eD + 1;
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X;
exp._y = _Y;
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X + 5;
exp._y = _Y;
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X - 5;
exp._y = _Y;
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X;
exp._y = _Y + 5;
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X + 5;
exp._y = _Y + 5;
depth = _root.getNextHighestDepth();
_root.attachMovie("exp","exp" + depth,depth);
exp = eval("_root.exp" + depth);
exp._x = _X - 5;
exp._y = _Y + 5;
this.removeMovieClip();
}
}
function fireLaser()
{
depth = _root.getNextHighestDepth();
_root.attachMovie("bossLaser","bL" + depth,depth);
bL = eval("_root.bL" + depth);
bL._x = _X;
bL._y = _Y - 15;
}
dx = 4;
h = 100;
timer = Math.random() * 30;